﻿namespace FlashPay.ORM
{
    using FlashPay.EF;
    using MySql.Data.MySqlClient;
    using System;
    using System.Data;

    public class DBUtils
    {
        public static IDbConnection CreateDBConnection(DBType dbType= DBType.MySql)
        {
            IDbConnection connection = null;

            switch (dbType)
            {
                case DBType.MySql:
                    connection = new MySqlConnection(Base.Mydb);
                    break;
                default:
                    throw new Exception("数据库类型错误！");
            }

            return connection;
        }
    }
}
